Passed
Push — master ( 16eb79...13846a )
by
unknown
04:07
created

Customer.getAddress   A

Complexity

Conditions 1

Size

Total Lines 3
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
1
import { Entity, Column, PrimaryGeneratedColumn, ManyToOne } from 'typeorm';
2
3
@Entity()
4
export class Customer {
5
  @PrimaryGeneratedColumn('uuid')
6
  private id: string;
7
8
  @Column({ type: 'varchar', nullable: false })
9
  private name: string;
10
11
  @Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
12
  private createdAt: Date;
13
14
  constructor(name: string) {
15
    this.name = name;
16
  }
17
18
  public getId(): string {
19
    return this.id;
20
  }
21
22
  public getName(): string {
23
    return this.name;
24
  }
25
26
  public getCreatedAt(): Date {
27
    return this.createdAt;
28
  }
29
30
  public updateName(name: string): void {
31
    this.name = name;
32
  }
33
}
34